package com.sa07.ui.config;

import java.util.List;

import com.sa07.exception.ConfigNotInitException;
import com.sa07.ui.bean.Menu;

/**
 * 菜单配置
 * 
 * @author Long.shangbo
 *
 * 2014-2-15 上午12:05:33
 */
public enum MenuConfig {
	INSTANCE;
	
	private List<Menu> menus = null;
	
	/**
	 * 初始化
	 */
	public void init(List<Menu> menuList){
		if(menus == null){
			menus = menuList;
		}
	}
	
	/**
	 * 获得菜单配置
	 * @return
	 */
	public List<Menu> getMenuConfig(){
		if(menus == null)
				throw new ConfigNotInitException("The menu config not init...");
		
		return menus;
	}
}
